package com.yang.crawler.article;

import com.yang.crawler.DownloadArticleCommand;
import com.yang.crawler.api.DownloadPdfService;
import com.yang.crawler.article.executor.DownloadArticleCmdExecutor;
import com.yang.crawler.common.Response;
import com.yang.crawler.dto.data.DownloadDTO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DownloadPdfServiceImpl implements DownloadPdfService {
    @Resource
    private DownloadArticleCmdExecutor downloadArticleCmdExecutor;

    @Override
    public Response<DownloadDTO> downloadArticle(DownloadArticleCommand downloadArticleCommand) {
        DownloadDTO downloadDTO = downloadArticleCmdExecutor.execute(downloadArticleCommand);
        return Response.success(downloadDTO);
    }
}
